#pragma once

#ifdef __QT5_TARGET

#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtSql/QSqlError>

#else

#include <QList>
#include <QStringList>
#include <QMap>
#include <QSqlError>
#include <QVariant>

#endif

#include "Filter.h"
#include "korlapadmin_model_global.h"

class KORLAPADMIN_MODEL_EXPORT FilterManager
{
public:
	FilterManager(void);
	~FilterManager(void);
	QList<Filter*> getAllFilters();
	QStringList getAllFilterNames();
	const Filter* findFilter(const QString& name);
	const Filter* getDefaultFilter();
	void setDefaultFilter(const QString& name);
	void loadFilters();
	int addFilterToDatabase(Filter* filter);
	void addFilter(Filter* filter);
private:
	Filter* defaultFilter;
	QMap<QString,Filter*> name_filter_map;
};
